package keter.queue;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class KafkaConsumer {
    private static final Logger logger = LoggerFactory.getLogger(KafkaConsumer.class);

    /**
     * 监听test主题,有消息就读取
     */
//    @KafkaListener(topics = {"msdp-statistics"})
    @KafkaListener(topics = {"test"})
    public void consumer(ConsumerRecord<?, ?> record){
        logger.info("test topic message : {}", record);
    }
}
